#include"head.h"


int dowork(int client_fd,transport_protocol_t msg){
    //ret，返回值0为成功，-1为失败。
    int ret=create_mysql(&msg.my_sql);
    if(ret==-1){
        char *temp="数据库连接失败";
        LOG_WRITE(3,temp);
    }
    //解析token，传出user_id
    char *user_id;
    analysis_is(&msg.my_sql,msg.token,&user_id);
    memcpy(msg.user_id,user_id,sizeof(msg.user_id));

    LOG_WRITE(2,"子线程执行长命令");
    switch(msg.flag_work){
    case 5:

        recvFile(client_fd,&msg);
        break;
    case 6:
        sendFile(client_fd,&msg);
        break;

    }

    return 0;
}
